InputCode = {
    codeText = "",
    code = love.graphics.newText(novaFont, ""),
    draw = function ()
        love.graphics.setLineWidth(7)
        love.graphics.rectangle(
            'line',
            love.graphics.getWidth()/2-love.graphics.getWidth()*0.8/2, 
            love.graphics.getHeight()/2 - 60/2, 
            love.graphics.getWidth()*0.8,
            60
        )
        love.graphics.draw(
            InputCode.code, 
            love.graphics.getWidth()/2 - InputCode.code:getWidth()/2, 
            love.graphics.getHeight()/2 - InputCode.code:getHeight()/2
        )
    end,
    addDigit = function (digit)
        if InputCode.codeText:len() < 7 then
            InputCode.setCode(InputCode.codeText..digit)
        end
    end,
    removeDigit = function ()
        inputCode.setCode(inputCode.codeText:sub(1, -2))
    end,
    setCode = function (code)
        InputCode.codeText = code
        InputCode.code:set(InputCode.codeText)
    end
}

function InputCode.getCode ()
    return InputCode.codeText
end

inputCode = InputCode
